From: Florian Müllner Date: Mon, 22 Feb 2016 17:11:56 +0000 (+0100) Subject: windowManager: Only animate dimming changes when necessary X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~1013^2^2~973 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=d8960b396b6e69cbb1193926d6d921bf0e609e6c;p=gnome-shell.git windowManager: Only animate dimming changes when necessary Now that we no longer skip dimming/undimming windows while showing the overview, we can still save a bit of work by changing the dimming without animation while the window is hidden. https://bugzilla.gnome.org/show_bug.cgi?id=762475 --- diff --git a/js/ui/windowManager.js b/js/ui/windowManager.js index a36a71ffc..bb54d836c 100644 --- a/js/ui/windowManager.js +++ b/js/ui/windowManager.js @@ -1367,11 +1367,14 @@ const WindowManager = new Lang.Class({ let dimmer = getWindowDimmer(actor); if (!dimmer) return; - Tweener.addTween(dimmer, - { dimFactor: 1.0, - time: DIM_TIME, - transition: 'linear' - }); + if (this._shouldAnimate()) + Tweener.addTween(dimmer, + { dimFactor: 1.0, + time: DIM_TIME, + transition: 'linear' + }); + else + dimmer.dimFactor = 1.0; }, _undimWindow: function(window) { @@ -1381,10 +1384,13 @@ const WindowManager = new Lang.Class({ let dimmer = getWindowDimmer(actor); if (!dimmer) return; - Tweener.addTween(dimmer, - { dimFactor: 0.0, - time: UNDIM_TIME, - transition: 'linear' }); + if (this._shouldAnimate()) + Tweener.addTween(dimmer, + { dimFactor: 0.0, + time: UNDIM_TIME, + transition: 'linear' }); + else + dimmer.dimFactor = 0.0; }, _mapWindow : function(shellwm, actor) {